<!DOCTYPE html>
<html lang="zh">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body style="margin: 10px">
    <div class="btn xxx">btn</div>
    <div class="btn xx2">xx2</div>
    <div class="btn xx3">xx3</div>
    <div class="btn xx4">xx4</div>
    <style>
      .btn {
        display: inline-block;
        padding: 10px 20px;
        background-color: red;
        margin: 20px;
        /* animation: xxx 1s ease-in infinite alternate; */
      }
      .xxx:hover {
        /* background-color: blue;
        transform: translateX(100px); */
        animation: xxx 1s ease-in infinite alternate;
      }

      @keyframes xxx {
        from {
          transform: scale(1);
        }
        to {
          transform: scale(1.2);
        }
      }

      .xx2:hover {
        /* background-color: blue;
        transform: translateX(100px); */
        animation: xx2 1s ease-in;
        transform-origin: top center;
      }

      @keyframes xx2 {
        0% {
          transform: skewX(0deg);
        }
        10% {
          transform: skewX(-10deg);
        }
        30% {
          transform: skewX(8deg);
        }
        50% {
          transform: skewX(-6deg);
        }
        70% {
          transform: skewX(4deg);
        }
        90% {
          transform: skewX(-2deg);
        }
        100% {
          transform: skewX(0deg);
        }
      }

      .xx3 {
        position: relative;
        z-index: 0;
      }
      .xx3::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: orange;
        z-index: -1;
        transform-origin: left center;
        transform: rotateY(90deg);
        transition: all 1s;
      }
      .xx3:hover::before {
        transform: rotateY(0deg);
      }

      .xx4 {
        position: relative;
        z-index: 0;
        overflow: hidden;
      }
      .xx4::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: orange;
        z-index: -1;
        border-radius: 50%;
        transition: all 1s;
        transform: scale(0);
      }
      .xx4:hover::before {
        transform: scale(1.5);
      }
    </style>
  </body>
</html>
